package javax.wireless.messaging;

import java.io.IOException;
import java.io.InterruptedIOException;

public class MessageConnectionImpl implements MessageConnection {
    private final String poin;

    private MessageListener Listener;

    private boolean a;

    public MessageConnectionImpl(String paramString) {
        this.poin = paramString;
        this.Listener = null;
        this.a = false;
    }

    public Message newMessage(String paramString) {
        return newMessage(paramString, this.poin);
    }

    public Message newMessage(String paramString1, String paramString2) {
        return new TextMessageImpl(paramString2, null);
    }

    public void send(Message paramMessage) throws IOException, InterruptedIOException {

    }

    public void setMessageListener(MessageListener paramMessageListener) throws IOException {
        this.Listener = paramMessageListener;
    }

    public Message receive() throws IOException, InterruptedIOException {
        return null;
    }

    public int numberOfSegments(Message paramMessage) {

        return (paramMessage instanceof TextMessageImpl) ? ((TextMessageImpl) paramMessage).data.length() / 160 + 1 : 1;
    }

    public void close() throws IOException {
        this.a = true;
    }
}